package org.proxydroidx;

import java.util.ArrayList;

import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.content.Context;

class Utils {
        
        public static final String SERVICE_NAME = "org.proxydroidx.ProxyDroidService";
        
        public static boolean isWorked(Context context) {
                ActivityManager myManager = (ActivityManager) context
                                .getSystemService(Context.ACTIVITY_SERVICE);
                ArrayList<RunningServiceInfo> runningService = (ArrayList<RunningServiceInfo>) myManager
                                .getRunningServices(30);
                for (int i = 0; i < runningService.size(); i++) {
                        if (runningService.get(i).service.getClassName().toString()
                                        .equals(SERVICE_NAME)) {
                                return true;
                        }
                }
                return false;
        }
}